Unable to get storage account container details - azure

Is there a way to get the storage account container details in Azure when private endpoint is enabled?
When i am trying to use get-azcontainer -name -context
I get an error saying this is not an authorised operation. However when i remove the private endpoint and enable public access. I am able to do so.
Hence, unable to figure out if there is any other way to achieve this
Tried using get-azcontainer. It didn't work as expected.
Request your help

Private endpoint means it is created with the help of VNet-Subnet.
So, you have to access the Storage account from the Virtual Machines connected to that Subnet added in your Storage Account > Networking > Vnet - Subnet which is linked with that Private Endpoint.
Reference: Microsoft Documentation of Azure Storage Account using Private Link

Related

How to Access Azure Data Factory if we disable public access for keyvault

So how we can fetch the secrets or keys for Azure Data Factory , logic apps, Azure Synapse and Azure DataBricks if we disable the public access for keyvault.
I found a solution for AppServices and FunctionApps by using outbound IP Addresses and i need a solution for accessing the ADF,synapse,logicapps and databricks if we disable public access for keyvault.
I tried using Service Principal and grant permissions but its not working.
Please help me with the solution.
Even if you disable public access, you can still leave "Allow trusted Microsoft services to bypass this firewall" on, and so allow the MS services you mention to have access.
You can also create a private endpoint, and so add the key vault to your private Vnet.
All of this is related to networking - not being blocked by a firewall. You also need to grant permission to the service you use to access key vault, for example, with service principle or managed identity.
I tried to reproduce the same in my environment to access Azure key Vault with Private Endpoint:
I have created Vnet with required configuration.
Subnet and AddressSpace
Azure Portal > Virtual networks > Create
Create key-vault with private endpoint.
Azure Portal > Key vaults > Create a key vault
Note under Network section uncheck public access.
once create the Keyvault, check the private endpoint provisioning status, like below.
If you are trying to access the Azure Keyvault from public internet, you will get unauthorized error, like below.
Azure Keyvault is accessible with private network, like below.
For accessing Azure Datafactory using Azure keyvault, Assign service principal.
Required Role: Key Vault Reader
Keyvault access policy is assigned to ADF managed Identity.
Ex: hellotestdata
You can add Azure Key vault as a linked service in the Azure Data factory. the managed identity of the ADF that has access to key vault can be used for connecting ADF to Azure Key vault like below.
Azure Key Vault is successfully linked to ADF.
Reference:
Store credentials in Azure Key Vault

Identity based authentication not working for Azure Storage File Share

We created an Azure Storage File Share and are trying to set up Identity-based authentication. We followed the GitHub sample for this that is available here: Azure Files Samples on GitHub
We were able to successfully run the following command to set up a user account corresponding to the storage account.
Join-AzStorageAccountForAuth `
-ResourceGroupName $ResourceGroupName `
-Name $StorageAccountName `
-DomainAccountType "ServiceLogonAccount" `
-OrganizationalUnitDistinguishedName "ou-distinguishedname-here"
After this, we mounted the Storage Account via Storage access keys and assigned the NTFS permissions on the file share. We also ensured that the SMB related contributor permission is also assigned on the File Share in the Storage Account in the Azure portal.
When we try to mount the file share we are getting prompted for the credentials and it is not connecting. We are trying to use the below command to try and connect:
net use Y: \\storageAccountName.file.core.windows.net\testShare
We ensured that we are trying these steps from a domain-joined computer with a domain user. The on-prem AD is connected to Azure AD via AD Connect that runs every 30 minutes. We ensured that this domain user is part of the AD groups that were assigned access on the File share in the Azure portal and also NTFS permissions on the share itself. The storage account has the Private Endpoint enabled and to reduce complexity, we are testing using the IP address that is assigned to the storage account.
Why is the command still asking for the credentials and not connecting to the File share? Anything we could be missing?
Found the resolution after more troubleshooting. The solution was that the DNS should be set up first. After setting up the DNS and trying to connect to the "storageAccountName.file.core.windows.net" instead of the IP address, the connection worked fine. It did not ask for any credentials and leveraged the logged-in domain user to connect.
I believe the Kerberos authentication requires the connection to the DNS name (instead of the direct IP address) as the object corresponding to the storage is set up to the name of the storage account.
Hopefully, this helps someone else facing this issue.

How to restrict/stop public (internet) access to Azure function?

I have several Azure Functions (Premium plan) which do some stuff and load the results to the storage blob. The connection to the storage account is restricted by a v-net so no public access to the storage account, however, I check and found that my (HTTP) azure functions can be triggered on the public internet.
How can I restrict this in the azure function, is there a way to do it through configuration?
Is this the way it's done?
Please help if there're other ways
You can set access restrictions in the portal through the networking blade. Click on Networking, then Configure Access Restrictions, and you can set access rules in there based on various options.
Instead of allowing specific IPS, i would request you to look at access restrictions to an Azure Function.
Add-AzWebAppAccessRestrictionRule -ResourceGroupName "ResourceGroup" -WebAppName "AppName" `-Name "Multi-source rule" -IpAddress "192.168.1.0/24,192.168.10.0/24,192.168.100.0/24" `
-Priority 100 -Action Allow

Connect Azure Data Factory with Private Endpoint to Storage Account with another Private Endpoint in the same VNet

Here is what I have:
1 VNet with Subnet1 and Subnet2.
1 Storage Account with Private Endpoint in Subnet1
1 Azure Data Factory with Private Endpoint in Subnet2
Public network access disabled for both of them.
I am trying to read and write a blob in the Storage Account using a Data Factory pipeline (Copy Data).
With the above setup, the Pipleline times-out, which I believe is because it is unable to resolve the Private IP for Storage Account.
What step(s) am I missing to correctly use the Private Endpoints in my setup above to be able to R/W blob via Data Factory?
Note: If I create Managed Private Endpoint in the Data Factory to connect to the Storage Account, the pipeline works and is able to read/write blobs.
Ref: https://learn.microsoft.com/en-us/azure/data-factory/managed-virtual-network-private-endpoint
Are Managed Private Endpoints the only way to connect to the Storage Account? If not, how do I configure the normal Private Endpoints?
Apart from managed private endpoints option there is another way to access Blob inside a VNET from ADF.
You can add Managed Identity ID of Datafactory in Blob Account > Access Control (IAM) and grant the ID "Storage Blob Data Contributor" role.

Powershell and Azure Resource Explorer showing different set of properties

I have created a private link connection to the storage account blob service, by the architecture, the private link has a private endpoint - which is linked to the interface in the virtual network and its subnet.
After the creation of the private link, the network interface which was provisioned gets the private IP address and FQDN - which is the name of the storage account and its public blob endpoint - like(myblob.blog.storage.net).
When I examine the network interface resource via Powershell, I can dig into members/properties and see the FQDN name.
PROBLEM: Unfortunately, I can not find any properties referencing to the private link connection on the network interface when I search via Azure Resource Explorer.
EDIT: Azure Resource Explorer is showing exactly the same information as to when we retrieve information via Powershell - using Get-AzResource command. Does this mean that we can't see all properties related to the resource via Resource Explorer as with dedicated Powershell resource commands - such as
Get-AzNetworkInterface ?
Yes, you can't see all properties related to the resource via Azure Resource Explorer.
The reason is that Azure Resource Explorer and Get-AzNetworkInterface are using different version of api in background.
For Azure Resource Explorer, it's using the old api whose version is 2018-07-01. Screenshot as below:
For Get-AzNetworkInterface, it's using the newest api whose version is 2019-11-01. Screenshot as below:

Resources