Good to see you made progress! Just one little thing: the endpoint shouldn't be required when creating the context for Azure (or any "provider").
As opposed to generic APIs [1] like OpenStack or CloudStack, Azure is a concrete provider with a well-known endpoint, so jclouds will already configure it for you. [1] http://jclouds.apache.org/start/concepts/ I. El 18/10/2015 3:05, "Ruben Rubio Rey" <[email protected]> escribió: > > Hi Ignasi, > > Thanks so much for your response. It has been very helpful. The hardest thing was to get the authentication right, so for future references I would like to send the following code instructios: > > 1 - Add azurecompute into the pom.xml > 2 - Generate the certificate (will create the pem, cert, p12 files and the P12_EXPORT_PASSWORD) > 3 - Upload to Azure portal (I used the old portal, I could not find the option in the new one) > 4 - The following code will authenticate and get the Compute Service. > > ComputeServiceContext context = ContextBuilder.newBuilder("azurecompute") > .credentials("/path/to/azure.p12", "P12_EXPORT_PASSWORD") > .endpoint(" https://management.core.windows.net/6ac5048e-6e83-4c99-a1a8-YOUR-SUSBCRIPTION-ID ") > .modules(modules) > .overrides(overrides) > .buildView(ComputeServiceContext.class); > ComputeService computeService = context.getComputeService(); > > Thanks for guiding me into the right direction. > > Regards, > Ruben > > > On Fri, Oct 16, 2015 at 8:36 AM, Ignasi Barrera <[email protected]> wrote: >> >> Hi! >> >> The way you start instances in Azure is the same in all providers. >> jclouds provides a portable layer you can use to create instances in >> different clouds using the same code. I recommend you read the >> "compute getting started guide" [1] to have a better understanding of >> how it works. >> >> You can also try the compute-basics example [2]. The code is simple >> and to the point, and you can compile and run it to deploy also on >> azure (although you'll need to explicitly add the azurecompute >> dependency to the pom.xml). Have a look at the azurecompute readme [3] >> for the details on how to generate the credentials and what identity >> and credential jclouds expects. >> >> HTH! >> >> I. >> >> >> [1] http://jclouds.apache.org/start/compute/ >> [2] https://github.com/jclouds/jclouds-examples/tree/master/compute-basics >> [3] https://github.com/jclouds/jclouds-labs/tree/master/azurecompute >> >> On 14 October 2015 at 11:03, Ruben Rubio Rey <[email protected]> wrote: >> > Hi Everyone, >> > >> > I am exploring the capabilities for Azure but azurecompute still under >> > development. As far I understand we should use AzureComputeApi. >> > >> > Could anyone please tell me how to create a new instance using >> > AzureComputeApi ? >> > >> > Regards, >> > Ruben >> > > >
