WebService PublicIP是“无”。 [英] WebService PublicIP is "None"

查看:102
本文介绍了WebService PublicIP是“无”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我们一直在工作区部署一个网络服务(使用SSL和CNAME)。



我们遇到的问题是我们无法从服务中获取publicIP,这是我们修改DNS以指向服务所必需的。



这是我们的配置: 

aci_config = AciWebservice.deploy_configuration(cpu_cores = 1, 

                          memory_gb = 1,

                          enable_app_insights = True, 

                          auth_enabled =真,

                                                ssl_enabled = True,

                                                ssl_cert_pem_file =

                                                "public.pem", 

                                                ssl_key_pem_file =

                                                "private.pem", 

                                                ssl_cname =" www.somedomainname.com")



当我们查看门户网站或序列化webservice对象时,publicIP属性为"None" ; $


{'name':'servicename1',

'描述':无,b
'标签':{},

'属性':{},

'州':'健康',

...... .... snip ..............
$
'authEnabled':是的,

'ssslEnabled':是的,
'appInsightsEnabled':是的,

'sslCertificate':'',

'ssslKey':'',

' cname':'www.somedomainname.com',

'publicIp':无}



我们如何获得我们服务的publicIP ?

We have been deploying a webservice in our workspace (with SSL and a CNAME).

The problem we are having is that we cannot get the publicIP from the service, which is required for us to modify our DNS to point to the service.

Here's our config : 
aci_config = AciWebservice.deploy_configuration(cpu_cores=1, 
                                                memory_gb=1,
                                                enable_app_insights=True, 
                                                auth_enabled=True,
                                                ssl_enabled=True,
                                                ssl_cert_pem_file=
                                                "public.pem", 
                                                ssl_key_pem_file=
                                                "private.pem", 
                                                ssl_cname="www.somedomainname.com")

When we take a look at the portal or when we serialize the webservice object, the publicIP attribute is "None"

{'name': 'servicename1',
'description': None,
'tags': {},
'properties': {},
'state': 'Healthy',
..........snip..............
'authEnabled': True,
'sslEnabled': True,
'appInsightsEnabled': True,
'sslCertificate': '',
'sslKey': '',
'cname': 'www.somedomainname.com',
'publicIp': None}

How can we get the publicIP of our service?

谢谢

推荐答案

你好Alex,

Hello Alex,

从上面看,您看起来正在部署配置,您可以在部署服务后获得评分URI。以下是

步骤
以部署服务并获取发布公共IP的URI。

From the above it looks like you are deploying the configuration, You can get the scoring URI after deploying the service. Here are the steps to deploy the service and get the URI which publishes the public IP.

配置映像并部署。以下代码执行以下步骤:



1.使用这些文件构建图像:

    - 得分文件,score.py。

    - 环境文件myenv.yml。

    - 模型文件。

2.在工作区下注册图像。

3.将图像发送到Container Instances容器。

4.使用映像在Container Instances中启动容器。

5.获取Web服务HTTP端点。

Configure the image and deploy. The following code goes through these steps:

1. Build an image by using these files:
   - The scoring file, score.py.
   - The environment file, myenv.yml.
   - The model file.
2. Register the image under the workspace.
3. Send the image to the Container Instances container.
4. Start up a container in Container Instances by using the image.
5. Get the web service HTTP endpoint.

%%time
from azureml.core.webservice import Webservice
from azureml.core.image import ContainerImage

# configure the image
image_config = ContainerImage.image_configuration(execution_script="score.py", 
                                                  runtime="python", 
                                                  conda_file="myenv.yml")

service = Webservice.deploy_from_model(workspace=ws,
                                       name='sklearn-mnist-svc',
                                       deployment_config=aciconfig,
                                       models=[model],
                                       image_config=image_config)

service.wait_for_deployment(show_output=True)

获取评分Web服务的HTTP端点,接受REST客户端调用。您可以与想要测试Web服务或将其集成到应用程序中的任何人共享此端点:

Get the scoring web service's HTTP endpoint, which accepts REST client calls. You can share this endpoint with anyone who wants to test the web service or integrate it into an application:

print(service.scoring_uri)

以下是我之前使用上述步骤部署的网络服务的屏幕截图。

Here is a screen shot of a webservice I deployed earlier using the above steps.




我希望这有助于您找到您的网络服务所需的IP。

I hope this helps you to find the required IP for your web service.


这篇关于WebService PublicIP是“无”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆