Azure Function: The term 'New-AzureStorageContext' is not recognized as a name of a cmdlet

Iron Contributor

I try to import the Azure.Storage module but I get the error that the New-AzureStorageContext was not found as cmdlet.

Jannik_Reinhard_0-1662218538893.png

 

Jannik_Reinhard_1-1662218560550.png


Can someone help me to fix this?

2 Replies

@Jannik_Reinhard 

 

As per their announcement in the various AzureRM commandlet help pages, the AzureRM module is due for retirement in 29th February 2024 (still a fair way off.)

 

 

LainRobertson_0-1662249567860.png

 

As noted in the final paragraph, they're already urging people to cut over to the Az (in your case it'd be Az.Storage) modules to "avoid service disruptions".

 

If you have a look at the "Cmdlet noun prefix changes", you'll see that in the case of New-AzureStorageContext it has become New-AzStorageContext.

 

 

If you can't cleanly cut over just yet, then read the section a few paragraphs down that talks about using Enable-AzureRmAlias which will allow existing scripts using AzureRM commandlet names to leverage the Az modules.

 

Here's an example of before and after running Enable-AzureRmAlias:

LainRobertson_1-1662249967388.png

 

That said, the best course of action given Microsoft's announcement is to use the new Az commandlet names - as guided by the "nouns" link above.

 

Cheers,

Lain

Thank you for the response. I found the issue it was the missing tag in the host.json to install the module. But I changed to the Az.Storage module

"managedDependency": {
"Enabled": true
}