Azure Env-based Auth
Azure AD environment-based authentication
Azure App registration
1. Create or use existing app registration
2. Make sure that the app is configured for a specific auth scenario:
Client credentials (might not work with SharePoint but require a Certificate-based auth)
Certificate
Username/Password (public clients flows must be enabled)
Managed identity
Follow instructions: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
O365 Admin -> Azure Active Directory
Generate self-signed certificate
or on a Linux or macOS client via openssl
:
Get scripts.
New App Registration
Accounts in this organizational directory only
API Permissions -> SharePoint :: Application :: Sites.FullControl.All -> Grant Admin Consent
Certificates & Secrets -> Upload
.cer
file
Use environment variables to provide creds bindings:
AZURE_TENANT_ID
- Directory (tenant) ID in App RegistrationAZURE_CLIENT_ID
- Application (client) ID in App RegistrationFor certificate-base auth:
AZURE_CERTIFICATE_PATH
- path to.pfx
fileAZURE_CERTIFICATE_PASSWORD
- password used for self-signed certificate
For username/password auth:
AZURE_USERNAME
AZURE_PASSWORD
Auth configuration and usage
Environment variables auto-injection
Environment variables can be automatically injected in a runtime for Azure AAD library. To use injection add correcponding environment variables in private.json
into env
JSON property:
Last updated