ChrisZ
ChrisZ

Reputation: 502

Azure failed to deploy: The host name myapp.azurewebsites.net is invalid

I am trying to deployment springboot application to Azure app services. and received error: com.microsoft.azure.CloudException: The host name my_app.azurewebsites.net is invalid. . . . Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: retrofit2.Response.class

I mimicked the steps illustrated here: https://learn.microsoft.com/en-us/java/azure/spring-framework/deploy-spring-boot-java-app-with-maven-plugin?view=azure-java-stable

I have install Azure CLI and use public key to connect. I have attached part of my pom.xml below, the plugin I added

 <plugin>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-webapp-maven-plugin</artifactId>
                <version>1.4.0</version>
                <configuration>
                    <deploymentType>jar</deploymentType>
                <!-- configure app to run on port 80, required by App Service -->
                <appSettings>
                    <property>
                        <name>JAVA_OPTS</name>
                        <value>-Dserver.port=80</value>
                    </property>
                </appSettings>

                <!-- Web App information -->
                <resourceGroup>my_group</resourceGroup>
                <appName>my_app</appName>
                <region>East US</region>

                <!-- Java Runtime Stack for Web App on Linux-->
                <linuxRuntime>jre8</linuxRuntime>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>2.2.11</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-core</artifactId>
                    <version>2.2.11</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>2.2.11</version>
                </dependency>
                <dependency>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                    <version>1.1.1</version>
                </dependency>
            </dependencies>
        </plugin>

Upvotes: 1

Views: 1574

Answers (2)

MStew
MStew

Reputation: 1275

Sign into the Azure portal and start the wizard to create a new web app to find an acceptable app name, then update your deployment config, and try again.

portal

Upvotes: 3

user793891
user793891

Reputation:

The appName value must be unique and must not have any invalid characters like an underscore.

Upvotes: 4

Related Questions