About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
windows_tools
⚠️
windows_first
Summary:
The documentation provides extensive examples using Azure PowerShell and references to PowerShell modules, which are most commonly used on Windows. In several sections, PowerShell is given equal or greater prominence than cross-platform tools, and there is no explicit mention of Linux-specific shell usage or guidance for Linux users. The documentation assumes familiarity with Windows-centric tools and patterns, potentially disadvantaging Linux users.
Recommendations:
- Explicitly state that Azure CLI and ARM templates are fully cross-platform and provide shell-agnostic examples (e.g., Bash, zsh) where possible.
- For PowerShell examples, clarify that PowerShell Core is available on Linux and macOS, and provide equivalent Bash or shell script examples for common tasks.
- Avoid using PowerShell as the only scripting example; always pair with Bash/Azure CLI where possible.
- Add notes or sections highlighting any differences or prerequisites for Linux users, such as installation steps for Azure CLI or PowerShell Core on Linux.
- Review and adjust the order of examples so that cross-platform tools (Azure CLI, ARM templates) are presented before or alongside PowerShell, rather than after.
Create pull request
Flagged Code Snippets
1. Run the `Update-AzFunctionApp -IdentityType UserAssigned -IdentityId` command to assign the identity in Functions:
# [Azure PowerShell](#tab/ps)
#### For App Service
Run the `Set-AzWebApp -AssignIdentity` command:
#### For Functions
Run the `Update-AzFunctionApp -IdentityType` command:
# [Azure PowerShell](#tab/ps)
#### For App Service
Adding a user-assigned identity in App Service by using Azure PowerShell is currently not supported.
#### For Functions
1. Create a user-assigned identity:
This response is the same as the [response for the Microsoft Entra service-to-service access token request](../active-directory/develop/v2-oauth2-client-creds-grant-flow.md#successful-response). To access Key Vault, add the value of `access_token` to a client connection with the vault.
# [.NET](#tab/dotnet)
> [!NOTE]
> When you connect to Azure SQL data sources by using [Entity Framework Core](/ef/core/), consider using [Microsoft.Data.SqlClient](/sql/connect/ado-net/sql/azure-active-directory-authentication). That namespace provides special connection strings for managed identity connectivity. For an example, see [Tutorial: Secure an Azure SQL Database connection from App Service by using a managed identity](tutorial-connect-msi-sql-database.md).
For .NET apps and functions, the simplest way to work with a managed identity is through the [Azure Identity client library for .NET](/dotnet/api/overview/azure/identity-readme?). For more information, see [Tutorial: Connect to Azure databases from App Service without secrets by using a managed identity](tutorial-connect-msi-azure-database.md).
For more information, see the respective documentation headings of the client library:
- [Add the Azure Identity client library to your project](/dotnet/api/overview/azure/identity-readme#getting-started)
- [Access an Azure service by using a system-assigned identity](/dotnet/api/overview/azure/identity-readme#authenticate-with-defaultazurecredential)
- [Access an Azure service by using a user-assigned identity](/dotnet/api/overview/azure/identity-readme#specify-a-user-assigned-managed-identity-with-defaultazurecredential)
The linked examples use [DefaultAzureCredential](/dotnet/api/overview/azure/identity-readme#defaultazurecredential). The same pattern works in Azure with managed identities and on your local machine without managed identities.
# [JavaScript](#tab/javascript)
For Node.js apps and JavaScript functions, the simplest way to work with a managed identity is through the [Azure Identity client library for JavaScript](/javascript/api/overview/azure/identity-readme?). For more information, see [Tutorial: Connect to Azure databases from App Service without secrets by using a managed identity](tutorial-connect-msi-azure-database.md).
For more information, see the respective documentation headings of the client library:
- [Add an Azure Identity client library to your project](/javascript/api/overview/azure/identity-readme#install-the-package)
- [Access an Azure service by using a system-assigned identity](/javascript/api/overview/azure/identity-readme#authenticate-with-defaultazurecredential)
- [Access an Azure service by using a user-assigned identity](/javascript/api/overview/azure/identity-readme#specify-a-user-assigned-managed-identity-with-defaultazurecredential)
The linked examples use [DefaultAzureCredential](/javascript/api/overview/azure/identity-readme#defaultazurecredential). The same pattern works in Azure with managed identities and on your local machine without managed identities.
For more code examples of the Azure Identity client library for JavaScript, see [Azure Identity examples](https://github.com/Azure/azure-sdk-for-js/blob/%40azure/identity_2.0.1/sdk/identity/identity/samples/AzureIdentityExamples.md).
# [Python](#tab/python)
For Python apps and functions, the simplest way to work with a managed identity is through the [Azure Identity client library for Python](/python/api/overview/azure/identity-readme). For more information, see [Tutorial: Connect to Azure databases from App Service without secrets by using a managed identity](tutorial-connect-msi-azure-database.md).
For more information, see the respective documentation headings of the client library:
- [Add an Azure Identity client library to your project](/python/api/overview/azure/identity-readme#getting-started)
- [Access an Azure service by using a system-assigned identity](/python/api/overview/azure/identity-readme#authenticate-with-defaultazurecredential)
- [Access an Azure service by using a user-assigned identity](/python/api/overview/azure/identity-readme#authenticate-with-a-user-assigned-managed-identity)
The linked examples use [DefaultAzureCredential](/python/api/overview/azure/identity-readme#defaultazurecredential). The same pattern works in Azure with managed identities and on your local machine without managed identities.
# [Java](#tab/java)
For Java apps and functions, the simplest way to work with a managed identity is through the [Azure Identity client library for Java](/java/api/overview/azure/identity-readme). For more information, see [Tutorial: Connect to Azure databases from App Service without secrets by using a managed identity](tutorial-connect-msi-azure-database.md).
For more information, see the respective documentation headings of the client library:
- [Add an Azure Identity client library to your project](/java/api/overview/azure/identity-readme#include-the-package)
- [Access an Azure service by using a system-assigned identity](/java/api/overview/azure/identity-readme#authenticate-with-defaultazurecredential)
- [Access an Azure service by using a user-assigned identity](/java/api/overview/azure/identity-readme#authenticate-a-user-assigned-managed-identity-with-defaultazurecredential)
The linked examples use [`DefaultAzureCredential`](/azure/developer/java/sdk/identity-azure-hosted-auth#default-azure-credential). The same pattern works in Azure with managed identities and on your local machine without managed identities.
For more code examples of the Azure Identity client library for Java, see [Azure Identity examples](https://github.com/Azure/azure-sdk-for-java/wiki/Azure-Identity-Examples).
# [PowerShell](#tab/powershell)
Use the following script to retrieve a token from the local endpoint by specifying a resource URI of an Azure service:
You can also remove the system-assigned identity by specifying `[system]` in `--identities`.
# [Azure PowerShell](#tab/ps)
#### For App Service
To remove a system-assigned identity for App Service, run the `Set-AzWebApp -AssignIdentity` command:
#### For Functions
To remove all identities in Azure PowerShell (Azure Functions only), run this command: