How to access Azure SQL Database via MSI in PowerShell - azure

is it possible to connect to Azure SQL Database by using Managed Service Identity? I'd like to rip out SQL credentials.
Thank you for your advises!
Best

Yes, it is possible. See this article for reference.

If you want to use a Managed Service Identity in Azure function you can have a look at this article:
How to use Azure Managed Service Identity (public preview) in App Service and Azure Functions
To authenticate to SQL with a Managed Service Identity you can have look at this article:
Azure SQL authentication with a Managed Service Identity
It should be enough to achieve what you need.

Related

Authenticate to Kusto using managed identities in Python

I'm trying to improve authentication to my Kusto clusters from my functions once they're deployed into production environment. Locally, I connect thru AZ CLI authentication, but I've found out that my organization generated a user assigned managed identity for my Kusto cluster.
I have a principalId and a clientId. How do I authenticate using the managed identity?
TIA
See example for use of MI Auth in the below link.
Please mind MIs only work when running in Azure in a host that this MI was attached to.
https://github.com/Azure/azure-kusto-python/blob/80cd8b61b681069e461141c98f4d7e29cdb4a783/azure-kusto-data/tests/sample.py#L61
Maybe you got not a manged identity but a application identity. This is a service account in azure ad.
That way, you can get a oauth2 token and use it to query the service.

Does Azure Managed Identities only work with Azure VM's?

I am trying to use a managed identity from Azure in a non-Azure VM to access my Azure resources. Is this possible?
You can use managed identities with App Service too
In the below link you can see all azure resources supported managed identities.
https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/services-support-managed-identities

Secure Azure App Service using Managed Identity (Asp.net Framework 4.7.2)

i'm trying to secure communication between two azure app services. i tried to use Managed Identity for that but the only thing i can find is: securing Database access using Managed identity.
So i'm kinda lost here, is Managed Identity can secure communication between two app services or its just responsible to secure resources like Azure Storage, Sql Server?
The MSI(Managed Identity) is used to secure Azure resources, essentially, it is a service principal in your Azure AD tenant, when granted corresponding permission, the MSI will be able to access corresponding resources.
To secure communication between two azure app services, MSI is not for such usage, you need to use Azure AD Apps to do this, register two AD Apps in Azure AD, one for client-app, and one for backend-app. If you enable the MSI of your App Service, it will just create a service principal i.e. enterprise application for you automatically without AD App(App registration).
Please refer to the steps I mentioned in this post.

Access Azure Table Storage with Azure MSI

I recently setup my .net core application to use MSI (Managed Identity) to communicate with Azure Blob.
Does MSI work with Azure Table Storage? Can't seem to find any documentation on it.
I am trying to use MSI so I don't have to manage my keys anymore (keyless).
Azure Table Storage does not support MSI. Table Storage does support Active Directory access. You can find the services that support MSI at the below link...
https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/services-support-msi
Managed identity provides Azure services with an automatically managed identity in Azure AD. You can use the identity to authenticate to any service that supports Azure AD authentication, including Key Vault, without any credentials in your code.
https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview
This is now supported using the latest version of
https://www.nuget.org/packages/Azure.Data.Tables/ (12.2.1)
You can now create an client using something like
var tableServiceClient = new TableServiceClient(uri, new DefaultAzureCredential());
Make sure you've assigned the correct permissions in Azure for the user to read from the resource

Azure Data Factory V2: Create linked service for Azure Sql server using Azure Active Directory

Creating linked service(Azure Data Factory V2) for Azure Sql supports SQL Authentication. I want to know if it also supports Azure Active Directory Integrated Authentication.
As of today (Feb '18),
ADFV2 can connect to some sources using Managed Service Identity (MSI). In short, the ADFV2 instance is given an identity in the Active Directory as an Active Directory Application. See the docs here. Then the ADFV2 can connect to data sources as that identity.
Although Azure SQL supports Managed Service Identity, accessing Azure SQL Server through MSI is not available for ADFV2 yet. From the docs:
ConnectionString: Specify information needed to connect to the Azure
SQL Database instance for the connectionString property. Only basic
authentication is supported. Mark this field as a SecureString to
store it securely in Data Factory, or reference a secret stored in
Azure Key Vault.
As the docs state, you can use the ADFV2 Managed Service Identity to connect to KeyVault and use keys and secrets stored there, which is probably your best best for limiting security information in configuration.
Keep in mind that the UI for ADFV2 is still quite far behind the API, so you may need to use PowerShell or Azure command line to set it up properly.

Resources