Introduction I tried creating a virtual machine with Ansible to Azure Stack. In conclusion, I was able to create a virtual machine with Ansible 2.4 and service principle.
My environment ASDK 1901 @physical container Ubuntu 18.04 Ansible 2.7.7 At first, I used Ansible 2.7.7 which pip installed to my machine. Then, the following error about creating virtual network occurred.
"msg": "Error creating or updating virtual network myVnet - Azure Error: NoRegisteredProviderFound\nMessage: No registered resource provider found for location 'local' and API version '2017-11-01' for type 'virtualNetworks'. The supported api-versions are '2014-12-01-preview, 2015-05-01-preview, 2015-06-15, 2016-03-30, 2016-06-01, 2016-07-01, 2016-08-01, 2016-09-01, 2016-10-01, 2016-11-01, 2016-12-01, 2017-03-01, 2017-04-01, 2017-06-01, 2017-08-01, 2017-09-01, 2017-10-01'. The supported locations are 'local'."I think that the reason is the different API version between Azure and Azure Stack. Ansible 2.7.7 uses API version 2017-11-01 for type virtual network. Azure supports this version. However, Azure Stack don’t support this version.
...